refactoring - 5.1/5.2 compatibility functions moved into pl.compat