Started a major refactor