Moved Namespaces and cleaned code