Break code for prepopulating asset reference field out into a helper function, so it can be used by other modules.