better metadata using json + some socket magic