reduced 5 queries per line to two queries per line
finalized changes to brands index