Refactor Rakefile