work-in-progress refactoring of input functions