Moved main preview part to refresh_preview()