refactored db_conn to gem