removing redundant code