added serialization test + docs and small refac