refactored code into namespaced subdirectories