cleaned up input processor