Refactor test layout