Refactor Rakefile.