skeleton so far
partial refactoring complete