encapsulate input preparation