added new user registration & some refactoring