with_type for attributes