Refactoring tasks in Rakefile