Refactored the implementation in Calendar class's following methods: weekday_number_today, weekday_number_yesterday by moving out the common code extracting week-day number from the datetime object to a private instance method week_day_number_from_date(datetime_object).

After the refactoring re-ran the specs and the refactoring didn't broke any specs which were passing before this refactoring.