refactored to support docket