Switched to Class-based implementation