some function improvement