Condensed a few lines

Used an existing helper function to replace some extra code.