Refactored sqrl.py