Refactored type controller.
Refactored user controller.