Another refactor. Better than the last