Refactored controllers. Upgraded Rails to 4.0.1