Your approach sounds a bit like a higher-level API, such as Catalyst, Ignite, or Lightning, which uses layers of abstractions for these training, logging, checkponting etc. routines so you might want to take a look at them.