PhpClass refactor