Refactor to non-SPA