Refactor rake task 'setup'