UI script refactor.