Refactoring - removing nested classes