Refactored user controller