code as module method with specs

Nice use of `module`