New code for class-based approach is added