Made switching widget work both ways.
Split up into files.