Refactoring: Move Stats and Log to own file.