Reorganized code into packages