Optimization acc.to prop.of string (thanks Alex)