Added conditional do and added anonymous namespaces