started a major refactor