test handler refactored