Move the user-defined hook into base class.
Add unit test for types translator.