Changed to class based approach