Extract logic to separate package, move command to cmd/goupx