Pal refactoring