Change signature of getHandler method to avoid caller having to cast return value.