refactor rake tasks