made code more modular, seperated in different files