Refactor out struct