extract method from the users_controller create action.
refactor materails_controller create action by extracting method.
Refactor routes by deleting unused routes by the application.
created custom flashes for success and error and refactored sessions and users controller to use it.
Refactor the users_controller with a before filter to prevent duplication.
Refactor the controllers to use the custom matchers and reduce clutter.