Modularize some of the utility-type functions