eliminate code redundancy