Refactoring into a common base class for tests