Move design to ui and fix some bugs