extract common code to CodeGeneration file
clean up namespaces