Refactored variable names and formatting cleanup