add stack frame list
 refactor code