start refactoring
refactored script structures