remove code redundancies