reorganize script for easier configuration and add Series Engine support