Output filename change; refactoring