add namespace, remove namespace pollution, bug fixed, refractored.