cleanup code of php models