move schedule code to its own namespace