get rid of redundant calculation