Restructure application files
Refactor view logic into view file