A more 'Pythonic' approach