connection is better when refactored