Dry the code up a bit