add serialization and templatify task_manager