refactor some