Fixing minor code redundancy