Refactoring pre_func in injection