If you already had leaks and problems then you already have a good idea of where to start looking for the issue and what to maybe fix first; yes?
If it's not any of those things, then you may look to the master cylinder.
But if you do a search on this forum, you will find plenty of informative posts on this subject already.
Good luck.