refactoring vulpes script