Revert "first round of refactoring"

Reverts kylophone/neg23#1