making method more generic