Refactor storing of logs to components