Clean up preview code