Simplify handler_type and make it SFINAE-friendly.