modify scripts to support leader/follower pattern.