split namespaces
fixed some bugs