Refactor and refine