How to replace a layer with own custom variant?