Refactor to make it easier to change tuning