Refactored utility tests