[IMP] imroved some code.