Moving code blocks in EJSON definition