improved 0x64 packet support, code refactorized using an optional_fields hash