Big: subsequent calls can override path with None, thus breaking it
Simplied code, reduced duplication.