make datatype modifying a bit more functional