Try to use catamorphism