Moved SQL calls into a separate file.