Begin major refactor