refactor code in caommand facade