refactoring frame class