Small script refactoring.