refactored encoding/decoding for ffield-objects