refactored how input parameter are parsed