Some heuristic stuff cleanup