Changed queries to DB. Renamed some files. No tests.