refactored js structure to correct default route