Refactor log parsing

Some cleanup regarding the log parsing process