improve the ui and other func