Refactored code into files for each component