Added edit profile functionality; refactoring