shortened clientSide.js by factor of 5 using underscore.js