PM plugin - more code clean-up