Getting rid of some duplicated code across the entire listings page and the class listings page