Added extra packages, some refactoring