Refactor the oracle processing