Working on cleaning up the future callback code, improving query