Rewrite getFrame to be more generic, less redundant