Add initial support for custom handlers.