refactor to expose serialize.args as separate function