MOB-176: Extract logic checking for wide table to a function, refactor GG code a lil bit for jquery and jshint