Hmm maybe this whole connection-related block should be inside of a `_prepare_connection()` helper or something?