moving initialization of layer default to contructor