refactor test for "free"