Refactor P09 and P10