moved layer customization code