Start to adapt mask code and integrate masking + layer styles