trimming code

DRY