Refactoring PA part - Not finished