Refactor and clarify