Refactor a few ui blocks.