reorganize code for change password