fix & cleanup. use pubsub
add libs