refactor similar