major structural overhaul, memory management on hold for now