get rid of redunant code