some edits to return more generic types