refactoring and add user controller