refactor some details