improving handler - some tests pass now