Remove unused widgets and optimize layout