Refactored RansomNote code to make it more readable