Refactoring tests and creating base class for such classes