Yet another refactor