Improve formatting and PHPDoc