added more refactoring/logic for yaml serialization