Refactored tests and added nested groups tests