Refactored rake tasks