optimize UI and coding