some refactoring and commenting, added tload onitoring