Refactor a bit to organize files. A few fields had to be made public