fix type and remove redundancy