merge from source preview optimization branch