Refactoring acc to PEAR standard