PA3 refactoring