Refactor push and pull of subdocuments