Refactor to align with scm-api