tests for open close and optimize
refactoring model classes
code clean up
code clean up