Refactor frame class