1. Extracted test function