extract leader/follower js into external files