Fix formatting and cleanup namespaces