Restructured for sbt. Refactored