implementation of the layer manager