modified structure and added namespaces to allow for autoloading