refactor replacement
fix test