move logView changes to one function