type provider pattern