Slight refactor to allow merging