refactor: refactor dataconnection code