actually did the refactor in this version