refactoring vehicle scripts