Refactoring of Scan2PC