simplified scripts and split functionality into different scripts