Refactor app into single page app