refactored; improved initialization - better OO, more tests.