Tidy up + performance fixing