Split hook implementation from main module file