refactor ascii handling into protocol. needs work