Refactored a test