Implemented also more clever prefix info handling - now it's gathered in one place, and consumed in two (in loops too).