refactor the stratos scripts