code cleanup & namespacing