Refactor add command