Improving getInput - adding default value & a filter function