General refactors. Add config CLI command support