Refactor for name changes

Changed some variable names for consistency and clarity