cleaned up variable argument parsing