Refactoring into command & package.
Add multi-tenant support.