pre-php refactor