Tidy up and simplification
Converted to use pyside