Refactor Rakefile to the dedicated script