refactor last change to make it work even more.