Cleaned up AVRO implementation