baring in mind #286, this would ultimately belong with the layer class.