reduce code duplication per code climate