Refactor for mono compatibility