remove redundant part of function