fix critical param conversion bug, refactor query creation
remove logging dependency, use stdlib logger