[#52] Simplify type guessing code