code refactor

remove redundant code