anishek/ashwin | #2322 | creating classes for various controls in JS and moving around a bit of code