Rework key handling

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>