get rid of redundant code