fix bug + improve UI class