Refactored ATA driver