Refactor into use of the same functions present in the ddp nom package, loginWithEmail... etc.