refactor masonry and add remote deletion