add some utility and resolve some TODOs