Refactored profile-related js files