refactoring and experimenting with custom serializers