Add user login check in database, some refactoring