Got all tests passing again after major refactor