Refactor of tests