Updated to PHP 5.3 and added factory classes