refactored line 51