should we do some sanity checking here? (e.g. allowed types etc)