updated ui + cleaned the code