refactored everything into packages, maybe merge this into master later today?