Refactor tests

DRYed out tests