modified to use keymaster namespace