refactor some tests