add limit password size and refactor code