middle of major refactor