done with type classes