Small refactor
Factor this out