move setup into environment.rb
refactor to pull things into a LocalRepository class