refactoring rectifier