refactor

refactor some func