adding getLayer() method and others adjustments