Dynamically make the correct input type