Clean up heuristic logic