refacto - much faster + --json option