move reply function to independent files