Refactor + past week stats bug fixed