Extracted logic from before and after to base test class.