setHandler implemented to allow extensions.