Leaflet refactoring