Remove redundant code in validation