use module pattern to scope classes correctly