refactored fix_date