lots of refractoring and clean up

package name changes