small refactor to make changing the input type easier DRY :-).