code cleanup, fixing method signature calls for TPQuery