added better way of managing inputs