Greatly simplified case class implementation, probably at some cost in perf