Refactored into features, fixed dates and added tests