Refactoring going on

In preparation for Spiritual EDB docs.