refactor to PHP5.4