Cleaned up controller and added a class method to the model instead of a rake task being called in the controller