Removal of uncessecary code