some clean up on core