refactor(API): encapsulate unit states