yet another refactor