simplify code, bugfixes PE3