improve some codes.