any particular reason for pulling this out into a function?