refactor wms previews