Small refactor for mono support.