big and good refactor