rewrite app into SPA
more SPA changes