refactoring a bit
updating autowoot for current API
updating for new api