Add register page and refactoring