refactor +first test for nested classes