debloat and reorganize code