remove case statement and reduce to message sending in process input loop