1. support formats in scripts
2. Do some code cleanup in PreProcessor.cs