- support restartbuild and abortbuild

small refactoring but keep api compability