Refactor test specs