JSON config & refactoring

Signed-off-by: Carlos Escribano Rey <carlos@markhaus.com>