simplified coding by removing redundant checks