substantial module cleanup