classes: migrate some classes to PHP5