Refactored code and renamed some properties