Now using PHP classes; updated architecture