refactored rake task