Improved work with layers