simplify code
merge from trunk