VSW: tried to sort out a semi-decent structure.