added improved cleanup strategy to core