refactor freelist