Refactor Infer