localize some imports

The explanation is here: #1813. Though I don't completely buy it though, I guess one could argue it's good style anyways?