Refactor UI classes.