split monlithique func in several func