remove useless code, modify some validation and notification