Worked to Class based implementation