Refactor RegisterController. fixed #104