Changed Structure to class structure