refactor, add frame class