moved to logicNP for key handling