refactor LogcatAgent and more docstrings