remove use of global variable, less use of attribute selector, improve naming, add class name as a property of input