code clean up for query ui widgets