Use scalaz for better polymorphism