slight cleanup

consolidated functions and renamed var ‘input’ to var ‘todoText’ .