added class setup method
refactor into packages for distribution