moved layer creation into a function so renderer plugin can override it