Refactor: Some tidy-up of the code and the packages organization