adding missing deps
code refactoring
code refactoring