Revised __init__.py - refactored large if/else blocks