This would greatly simplify javascript code and allow for easier review
This would greatly simplify javascript code and allow for easier review