handles different types of inputs based on types