llm code refactor