use inmap if fields size is one
typeclass instances should be implicit