refactored public facing js to only include required js modules and hence reduce errors