PySide optimization