Dry up code

Pointed out in #282.