Some refactor, and improved the setup command