Refactored code and variables for clarity and brevity