Refactored creation of previews