SQL reduction in module.

...ucing the amount of SQL in the module.