Refactor and go fmt