Refactoring, added redirect after registration