refactored user settings js file