removed duplicate redundant code