refactor getDSN method