refactor methods to access key value pairs with literals