replace conditions with function
should not call destory in a loop using the original list as it modifies the list causing concurrent modification exception
remove triggers, statics and payedCost target from getStateId
initial draft for 1.36