refactor to preserve call stack