refactor Rakefile and connected files