splitted code in differents files and rearranged to be solve circular dependency issue