Remove getTopLayerIndex, and use getTopLayer only