refactored map piece storage