Refactor application structure to components