refactor code.