moved code from scripts folders