Make serializers generic

Make serializers more generic by adding abstract class Serializer