Using JSON to Simplify Code