Refactor UI