reafctor and testing ui