final version with ref meta