convert to current mw standard for PFs, cleanup code a bit