refactoring of class structure