refactor and rewrite test cases, get coverage up to 100%, initialize widget from plugin file