Extracted (de)serialization stuff to separate file.
IDEA no longer complains.