refactored logs controller