heuristic factory