Code refactoring - extracted parseDate method