Refactoring P/F results and some cleanup (WIP).