Remove code smells

Refactor to use setUp functions, base classes, etc.