add factory struct
add query struct
add session struct