a bit of refactoring, rolling our own users registration