Moved code for extracting form input fields into separate Input module to reduce code duplication.