U: fix style and refactor