dry

remove duplication of code (a little)