Fixed encoding issue for text retrieved from task title and note
Refactored
Refactored according to ruby style guide