Refactored/Follwed rails_best_practices