Factoring in preparation for a Layer class.