Made some of (new) logic in __init__.py (slightly) more efficient