refactoring javascript variable names