improved package file parsing