refactoring the status showing code in scriptForInput.js