Good refactor. Should prevent headaches