UnDRYd code for readability