Moving this code around to have tests and sbt