improvements to Layer