should reject when data is not valid. and refactor code .