Adds support for multiple cm versions (including v5)