Improve apt handling