massive abstraction/encapsulation cleanup