Stronger typing, remove useless type, handle empty json