Add register functionality. Refactor to remote views