before refactor getFrame
refactor done