script reorganization, some class addition