refactored code and changed text