more succinct library type detection