made code more modular and separated objects into separate files