divide the code in 3 files