significantly refactord validation and packet field access