remvoing redundant code