refactoring for other classes