Refactors logs API