Refactor yesterday code