code core cleanup