Moved modularized a method in processInput() and moved it to a more logical place