added namespaces and improved file organization