Getting rid of extra SQL calls.