supports an opts object for parsing key types