PUFA implemented, additional refactoring