moved and refactored

moved classes to the appropriate package
refactored and integrated the two code bases