refactor due list code to be more testable