Refactored test