Better type definition and pretty print