refactor on tests