Improve builder code and conform to PHP 5.4 standards.