phpdoc and code cleanup