Preparing for multiple day support, major refactoring.