move connection to own file