factor out beat clock into master/slave structure