Refactor to use some utility classes.