Refactor locals