removed async queries - major code cleanup/restructure