Error handlers can be defined using the error_handler decorator
Simplify target_handler decorator

Also, fix indentation