@lossyrob, any suggestions of whether this can be rewritten and if so how. An extractor pattern can be useful here but I wasn't sure how. I tried using unapply but the compiler complains because Context is a case class so gets a default unapply. On the other hand, I don't want to introduce a new case class to just have PyramidMetadata and TileIdPartitioner - that's what Context is for.