add user registration and some improvements