removed logic part from P5LhingsDevice to main of processing