moving out the common input elements to main