refactoring scripts to server type