Bit of restructuring to make a few things better