type class comes to be handy
finish the translation of type class