Added custom LayoutAdapter, refactored serialization class