big re-org into classes