Improved initialization and preview generation