refactoring to get each core function as a single function call per file