Rename some functions
Javascript refactoring