Restructured files. Fixed AD query.