Refactor and PHPDoc