Performance tweaks in DB calls

Improved performance 5-10% on DB calls