Did a lot of cleaning up in TerrainLayer