Consolidate action and pmessage functions