thought about splitting this function into two, with one case to explicitly handle re-declaration, but wasn't sure how much value this adds. thoughts?