VIVO-758 move methods to where they are used.