This should probably be an internal function first to allow re-use without needing the ``self`` var:
```
function register() {
...
}
this.register = register;
```