Some refactoring and setup dependencies script