This seems like something that should be in a utility class