Porting commands to class model, centralize common patterns.