Updated the Register controller and View to follow the MVC architecture strictly.