Refactored code to have more consistent naming.