Separate out implementations of LazyMask and FunctionalMask