reorganization, improve scripts