remove fonction from the main programme and spread over others files