refactor to single page webapp