refactored connection with Data