delete redundant bean and refactor