define type constrcutor as functions