kmsutils: improve source code

Change-Id: I2a8ab847797becdb021128c8c7a135d3a124771b