Here is a link to an article that talks about ways to maximize your savings in a 401(k):
The article provides good advice that if you are still working at age 70 1/2, when RMDs are required for traditional 401(k)s and IRAs, it pays to keep your 401(k) and not roll it into an IRA, to avoid RMDs. Once you do retire or any time you leave a job and have a 401(k) from that job, I recommend you transfer the 401(k) to an IRA to give you more investment flexibility. There are some reasons to not do this and your financial advisor can help you sort this out.
The article mentions having an emergency fund, which I fully endorse, however, what takes precedent is getting your company match in your 401(k). It always pays to contribute the amount that gets you all of your company match, because that is free money you should never give up.
Enjoy the article!