refactor rake task