Package changes, some refactors, removed unused code.