refactor commands.go a bit, specifically error handling