JSON big int workaround and code optimizations