implemented getMapItems and getLayers, done some refactoring