This block looks like something that can go into a utility class so that we don't have to copy/pasta.