abstract out component.json

so this code can be used independent of component.json