Reduce code duplication

This removes longstanding TODOs