refactor oplog stuff into its own file