refactor table data structure for keys
added some todo comments on areas that need further investigation
added an IWidget interface definition