better filter based serialization