instruments: move function definition to separate file