Updated filter creation.
Improved script generation