Eliminate code duplication.
merge trunk