Cleanup

Revisiting the dsn diff I found some code that could be cleaned up. Please review.