Refactor on user management