cleanup
structural changes and initial tests