refactor of test