js refactoring method names