php: refactoring + WHEREIS pwd