Refactor gc