Heuristic Refactor