add docstrings
add todo
use string formatting for less duplication
use lambda to avoid duplicating slot functions
comply to PEP8 coding style