Small refactoring in client javacript for json consuming in twitter panel component