encapsulate input preparation in separate module