don't use std::function as it uses a lot more memory than Module*