add implementation and test for setting field types