Some refactoring to replace local queue code
General refactoring of PActor