Move constant to config/settings, plus JavaScript refactoring