Layering improvements and more layer state implementation