Better reactive -- lock properly, remove unused arguments, send "end" to deamon thread