better input processor
reorganized