Re-ordered everything, cleaned up architecture