Refactor and Reorder for clarity and consistency