Completely refactor the SPA code. Removed all module dependencies