Refactor to make implementation less single-track focused