fix and clean core