Continue merging P2GAM code in handler

almost all test cases work again