refactor some codes
refactor