single page application refactoring - in  progress