refactoring legal design test