refactoring js locations html php