Refactoring js and names