Reworked things to be simpler.