Split input handling into module