Code refactoring   moved nested class to separate files