ut and refactor