refactored user controller