Refactored packfile protocol file