Extract the fetching of the meta data into a separate function
Add some basic tests