Refactor application layout