Split up Datalog internals