refactoring js locations