Refactor rakefile