install mongoose and mongodb to project, after that apply some refactoring