big relocation of functions, separated modal modules