refactor of SCM api