fix log
refactoring
refactoring connection