refactored byzanz into separate more robust script