started the code cleanup for queries built as string, and added phpdoc (1)