Beginning to refactor the code, organized the files