restructured to support standalone domain