removing redundant code.
removing more redundant logic.