Splitting out into separate functions and catering for differing types being sent back.