refactor replaceList type checking