style schedule, slight reorganization of template code