Modularize the doob singleton, structure io