Refactored With Rails 4