REF #4021,REF #4066,REF #4067
not completely merged(minor changes)