Small restructuring + a few features