slight refactor on tests