extract type converter to a seprated class