main driver refactoring, moved input handlers into their own modules