cleanup on the way the script works and how the security scripts are called