small code changes about optional parameters