refactor, clearing input