Class based restructure

current version for review