Manual type deduction for keys and values