Nightly build, refactoring, part 1
Refactoring, part 2
Refactored! Yay