Some restructuring now that it works as intended