Code is now clean and consistent, and logically split in different files