refactoring and testing of weekmodel