Use serializer to extract input data, fix #31