improved javascript readability